import junit.framework.TestCase;


public class LiczbaTest3 extends TestCase {
	Liczba test;
	protected void setUp() throws Exception {
		test = new Liczba(6);
	}
	
	public void testZapis() throws Wyjatki {
		
		assertNotNull ("test not null", test);
	}
	
	public void testZapis2() throws Wyjatki {
		assertFalse ("(12)4 = 6", "12".compareTo(test.zapis(4)) != 0);
	}
	
	public void testZapisBool() throws Wyjatki {
		assertTrue ("(12)4 = 6", "12".compareTo(test.zapis(4)) == 0);
	}
	
	public void testZapisEquals() throws Wyjatki {
		assertEquals ("(20)3 = 6", "20", test.zapis(3));
		assertEquals ("(12)4 = 6", "12", test.zapis(4));
		assertEquals ("(11)5 = 6", "11", test.zapis(5));
	}
	
	public void testZapisExceptions() throws Wyjatki {

		try { test.zapis(-2); fail ("Oczekiwano wyjatku");}
		catch (Wyjatki ex){}
		
		try { test.zapis(34); fail ("Oczekiwano wyjatku");}
		catch (Wyjatki ex){}
	}
	

	protected void tearDown() throws Exception {
		test = null;
	}
}
